import requests

# # 1.超时
# base_url = r'http://httpbin.org/'
# url = base_url + 'get'
# resp = requests.get(url, timeout=3)
# # resp = requests.get(url,timeout=(0.1,0.5))
# print(resp.status_code)
# print(resp.text)

# 2.SSL验证
# 访问 12306 首页
url = r'https://www.12306.cn/index/'
resp = requests.get(url,verify=False)
resp.encoding = 'utf-8'
print(resp.text)

# 身份认证
# 基本身份认证：访问 tomcat 主机管理页